<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>键盘事件</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <div id="root">
        <input type="text" v-on:keyup.enter="fun" name="" id="" placeholder="输入回车提交">
        <input type="text" @keydown.ctrl="fun" name="" id="" placeholder="输入ctrl提交">
        <input type="text" @keydown.ctrl.alt="fun" name="" id="" placeholder="输入ctrl+alt提交">
        <input type="text" v-on:keyup.csx="fun" name="" id="" placeholder="输入回车提交">
    </div>
</body>
<script>
    Vue.config.keyCodes.csx = 13
    new Vue({
        el: "#root",
        methods: {
            fun() {
                console.log(event.target.value)
            }
        }
    })
</script>

</html>